package com.micai.springboot;

import com.micai.springboot.property.HomeProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * Spring Boot应用启动类
 *
 * @author 赵新国 on 2017/8/21.
 */
@SpringBootApplication // Spring Boot 应用的标识
public class Application implements CommandLineRunner{

    @Autowired
    private HomeProperties homeProperties;

    public static void main(String [] args){
        // 程序启动入口
        // 启动嵌入式的 Tomcat 并初始化 Spring 环境及其各 Spring 组件
        SpringApplication.run(Application.class,args);
    }

    @Override
    public void run(String... strings) throws Exception {
        System.out.println("\n" + homeProperties.toString());
        System.out.println();
    }
}
